package com.okhttpfinal;


/**
 * Desction:
 * Author:pengjianbo
 * Date:15/9/29 下午4:06
 */
public abstract class MyBaseHttpRequestCallback<T extends BaseApiResponse> extends BaseHttpRequestCallback<T> {

    @Override
    protected void onSuccess(T t) {
        int code = t.getCode();
        if (code == 0) {
            onRequestSuccess(t);
        } else {
            onRequestFailure(t);
        }
    }

    public abstract void onRequestSuccess(T response);

    public abstract void onRequestFailure(T message);
}
